import torch
import torch.nn.functional as fc
import matplotlib.pyplot as plt

x = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1)
print(x.size())
y = x ** 2 + 0.2 * torch.rand(x.size())
print(x, y)

# 画散点图
plt.scatter(x.numpy(), y.numpy())
plt.show()
